package com.zhijian.demo.pojo;

import java.util.Objects;

/**
 * TODO
 * 返回结果类：{
 * code：状态码     1-失败， 0-成功
 * data：数据
 * }
 * @author chenzhijian
 * @date 2023/10/17
 */
public class Res {
    int code;
    String data;

    public Res() {
    }

    public Res(int code, String data) {
        this.code = code;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Res res = (Res) o;
        return code == res.code && Objects.equals(data, res.data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, data);
    }

    @Override
    public String toString() {
        return "Res{" +
                "code=" + code +
                ", data='" + data + '\'' +
                '}';
    }
}
